<?php
$this->breadcrumbs = array(
    '消息记录'
);
?>
<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'search-form',
    'type' => 'search',
    'method' => 'GET',
    'htmlOptions' => array('class' => 'navbar-search pull-left', 'style' => 'margin:0;width:100%;'),
));
?>
<div class="submenu">
    <div class="row">
        <div class="col-xs-4">
            <?php
            echo CHtml::tag('button', array('type' => 'button', 'class' => 'btn btn-default btn-full', 'data-datepicker' => 'range', 'data-time-from' => '#Video_time_begin', 'data-time-to' => '#Video_time_end', 'data-time-ranges' => 'true', 'data-time-delta' => 30), ' ');
            echo $form->hiddenField($model, 'time_begin');
            echo $form->hiddenField($model, 'time_end');
            ?>
        </div>

        <div class="col-xs-3">
            <?php
            echo $form->textFieldRow($model, 'searchKey');
            ?>
        </div>

        <div class="col-xs-2">
            <?php
            echo $form->dropDownList($model, 'task_id', Task::getOptions('tasks', array('' => '所属采集任务')),
                array('class' => 'form-control', 'data-select' => 'picker', 'data-live-search' => 'true'));
            ?>
        </div>

        <div class="col-xs-2">
            <?php
            echo $form->dropDownList($model, 'status', Video::getOptions('status', array('' => '===视频状态===')),array('class' => 'form-control',));
            ?>
        </div>

        <div class="col-xs-1">
            <button class="btn btn-primary" style="width:100%;" type="submit" name="yt0"><i class="fa fa-search"></i>
            </button>
        </div>
    </div>

</div>
<?php
$this->endWidget();
?>
<div>
    <?php
    $columns = array(
        array('header' => '视频名称', 'name' => 'name', 'value' => array($this, 'colRevise'), 'type' => 'raw', 'headerHtmlOptions' => array('style' => 'width:30%')),
        array('header' => '视频首页图片', 'name' => 'avetar', 'value' => array($this, 'colRevise'), 'type' => 'raw', 'headerHtmlOptions' => array('style' => 'width:20%')),
        array('header' => '视频采集状态', 'name' => 'status', 'value' => array($this, 'colRevise'), 'type' => 'raw', 'headerHtmlOptions' => array('style' => 'width:20%')),
        array('header' => '任务更新时间', 'name' => 'time_update', 'value' => array($this, 'colRevise'), 'type' => 'raw', 'headerHtmlOptions' => array('style' => 'width:20%')),
        array('header' => '所属的采集任务', 'name' => 'task', 'value' => array($this, 'colRevise'), 'type' => 'raw', 'headerHtmlOptions' => array('style' => 'width:20%')),
        array('header' => '操作', 'name' => 'operations', 'value' => array($this, 'colRevise'), 'type' => 'raw', 'headerHtmlOptions' =>
            array('style' => 'width:10%')),
    );
    $this->widget('bootstrap.widgets.TbGridView', array(
        'id' => 'model-grid',
        'ajaxVar' => null,
        'type' => array(),
        'enableSorting' => true,
        'dataProvider' => $model->searchByKey(),
        'columns' => $columns,
    ));
    ?>
</div>